home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / util / cli / ECmd21p_bin.lha / ExtraCmds / doc / Find.man < prev    next >
Encoding:
Text File  |  1993-12-28  |  10.2 KB  |  265 lines

  1.  
  2.  
  3.  
  4. FIND(V37)                                               FIND(V37)
  5.  
  6.  
  7. FFOORRMMAATT
  8.        FFIINNDD [ DDIIRR ] _d_i_r_e_c_t_o_r_y [ DDEEPPTTHH ] [ EEXXPPRREESSSSIIOONN ] _e_x_p_r_e_s_s_i_o_n
  9.  
  10. TTEEMMPPLLAATTEE
  11.        DDIIRR//AA,,DDEEPPTTHH//SS,,EEXXPPRREESSSSIIOONN//FF//AA
  12.  
  13. PPUURRPPOOSSEE
  14.        To find files and directories.
  15.  
  16. SSPPEECCIIFFIICCAATTIIOONN
  17.        FFIINNDD recursively  descends  the  directory  hierarchy  for
  18.        _d_i_r_e_c_t_o_r_y  seeking  files  and  directories that match the
  19.        _e_x_p_r_e_s_s_i_o_n written using the functions given below. In the
  20.        descriptions, the argument _n is used as a decimal integer.
  21.        GGTT _n means greater than _n, LLTT _n means less than _n, and  EEQQ
  22.        _n,  or simply _n, means exactly _n.  The DDEEPPTTHH switch causes
  23.        the descent of the directory hierarchy to be done so  that
  24.        all  entries in a directory are acted on before the direc­
  25.        tory itself. The function and operator names are not  case
  26.        sensitive.
  27.  
  28.        The _e_x_p_r_e_s_s_i_o_n is made up of:
  29.  
  30.        CCOOMMMMEENNTT _p_a_t_t_e_r_n
  31.               True if _p_a_t_t_e_r_n matches the comment attached to the
  32.               current name.
  33.  
  34.        DDAAYYSS [GGTT|LLTT|EEQQ] _n
  35.               True if the file or directory has been modified  in
  36.               _n days.
  37.  
  38.        EEXXEECC _c_o_m_m_m_a_n_d
  39.               True  if  the executed _c_o_m_m_a_n_d returns a zero value
  40.               as its  return  code.  A  _c_o_m_m_a_n_d  line  containing
  41.               whitespace must either have the whitespace escaped,
  42.               or be surrounded by quotes. A command  argument  {}
  43.               is  replaced by the current name (with its relative
  44.               path).
  45.  
  46.        EEXXEECCOOKK _c_o_m_m_a_n_d
  47.               As EEXXEECC except that the generated command  line  is
  48.               printed  with a question mark, and is executed only
  49.               if the user responds by typing a yy.
  50.  
  51.        FFLLAAGGSS _f_l_a_g_s
  52.               True if _f_l_a_g_s matches the protection  bits  of  the
  53.               current  name.   The  _f_l_a_g_s argument is a string of
  54.               letters representing the protection bits: rr  -  the
  55.               file  can be read.  ww - the file can be written to.
  56.               ee - the file is an executable  program.   dd  -  the
  57.               file  can be deleted.  ss - the file is a script.  pp
  58.               - the file can be made resident.  aa - the file  has
  59.               been archived. If a letter is preceded by a '--', it
  60.               means that in order  to  match,  the  corresponding
  61.  
  62.  
  63.  
  64. Find version 37.2          22 May 1993                          1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. FIND(V37)                                               FIND(V37)
  71.  
  72.  
  73.               file  bit  must  not  be  set. Unspecified bits are
  74.               ignored  in  the  comparison.  Whitespace  is   not
  75.               allowed in _f_l_a_g_s.
  76.  
  77.        LLFFOORRMMAATT _f_m_t_s_t_r_i_n_g
  78.               Always  true; prints _f_m_t_s_t_r_i_n_g replacing occurences
  79.               of %N with the name of the object, %R with its rel­
  80.               ative  path,  %L  with its length in bytes (this is
  81.               only useful for file type objects), and %C with any
  82.               attached comments. To print a % character use %%.
  83.  
  84.        NNAAMMEE _p_a_t_t_e_r_n
  85.               True if _p_a_t_t_e_r_n matches the current name.
  86.  
  87.        PPRRIINNTT  Always  true; causes the current name to be printed
  88.               (with its relative path).
  89.  
  90.        PPRRUUNNEE  Always true. Has the side  effect  of  pruning  the
  91.               search  tree  at the current name. Necessary if the
  92.               DDEEPPTTHH switch isn't used and the directory currently
  93.               being matched is deleted.
  94.  
  95.        RREEXXXX _s_t_r_i_n_g_-_f_i_l_e
  96.               True  if  the ARexx _s_t_r_i_n_g_-_f_i_l_e returns with a zero
  97.               return code. An Arexx string-file  is  a  one  line
  98.               program  given  directly  on  the command line. The
  99.               ARexx interface supports one command: GGEETTAATTTTRR _s_t_e_m_.
  100.               where  _s_t_e_m_.   (remember  the  trailing dot) is the
  101.               name of the ARexx  stem  variable  the  information
  102.               about  the  current  name  is to be placed in.  The
  103.               resulting compound symbol will have  the  following
  104.               nodes:  ..NNAAMMEE  - the current name without its path.
  105.               ..RREELLNNAAMMEE - the current name with its relative path.
  106.               ..FFUULLLLNNAAMMEE  -  the  current name with its full path.
  107.               ..CCOOMMMMEENNTT - the  optional  attached  comment  or  an
  108.               empty  string.   ..TTYYPPEE  - the type: FFIILLEE, LLIINNKKFFIILLEE,
  109.               DDIIRR, LLIINNKKDDIIRR, SSOOFFTTLLIINNKK, or UUNNKKNNOOWWNN.   ..SSIIZZEE  -  the
  110.               size  in  bytes. Only meaningful for files.  ..DDAAYY -
  111.               the name of  the  day  of  the  last  modification.
  112.               ..DDAATTEE  - the last modification date in the standard
  113.               Amiga format.  ..TTIIMMEE - the last  modification  time
  114.               in  the  standard  Amiga format.  ..DDAAYYSS, ..MMIINNSS, and
  115.               ..TTIICCKKSS  -  the  time  of  the   last   modification
  116.               expressed  as  the  number of days since January 1,
  117.               1978, the number of minutes past midnight, and  the
  118.               number of 'ticks' past the minute.
  119.  
  120.        SSIINNCCEE _d_a_t_e
  121.               True  if the file or directory has been modified on
  122.               or after _d_a_t_e.   The  format  for  _d_a_t_e  is  either
  123.               _d_d_-_m_m_m_-_y_y  or  one  of  TTOOMMOORRRROOWW, TTOODDAAYY, YYEESSTTEERRDDAAYY,
  124.               MMOONNDDAAYY, TTUUEESSDDAAYY, WWEEDDNNEESSDDAAYY, TTHHUURRSSDDAAYY, FFRRIIDDAAYY,  SSAATT­­
  125.               UURRDDAAYY, or SSUUNNDDAAYY.
  126.  
  127.  
  128.  
  129.  
  130. Find version 37.2          22 May 1993                          2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. FIND(V37)                                               FIND(V37)
  137.  
  138.  
  139.        SSIIZZEE [GGTT|LLTT|EEQQ] _n
  140.               True  if  the file is _n bytes long. Always false if
  141.               the current name is not a (hard link to a) file.
  142.  
  143.        TTYYPPEE _t_y_p_e
  144.               True if the type of the filesystem object is  _t_y_p_e,
  145.               where  _t_y_p_e is one of FFIILLEE, LLIINNKKFFIILLEE, DDIIRR, LLIINNKKDDIIRR,
  146.               or SSOOFFTTLLIINNKK for file, hard link to file, directory,
  147.               hard  link  to directory, or soft link to a file or
  148.               directory, respectively.
  149.  
  150.        UUPPTTOO _d_a_t_e
  151.               True if the file or directory has been modified  on
  152.               or before _d_a_t_e.
  153.  
  154.        { _e_x_p_r_e_s_s_i_o_n }
  155.               True if the expression inside the braces is true.
  156.  
  157.        The  functions  may be combined using the following opera­
  158.        tors:
  159.  
  160.        NNOOTT    The negation of a function.
  161.  
  162.        AANNDD    Concatenation of  functions.  The  keyword  AANNDD  is
  163.               optional,  as it is implied by the juxtaposition of
  164.               two functions.
  165.  
  166.        OORR     Alternation of functions.
  167.  
  168.        FFIINNDD uses '*' as an escape character to remove the special
  169.        meaning  of characters, so to get an '*', you will have to
  170.        enter '**'. The special escape  sequences  '*N'  and  '*T'
  171.        mean the new-line and tab characters, respectively. Escap­
  172.        ing works everywhere in the _e_x_p_r_e_s_s_i_o_n,  not  just  inside
  173.        double quotes. You can even escape the space character:
  174.  
  175.        exec delete* *{*}
  176.  
  177.        gives exactly the same result as
  178.  
  179.        exec "delete {}"
  180.  
  181. EEXXAAMMPPLLEESS
  182.        To remove all files ending in '!' or '.bak':
  183.  
  184.        1> FIND SYS: {NAME #?! OR NAME #?.bak} EXEC "DELETE {}"
  185.  
  186.        To find all files ending in '.c' on DH0: without searching
  187.        the sub-tree starting at the directory 'foo':
  188.  
  189.        1> FIND DH0: {TYPE DIR NAME foo PRUNE} OR NAME #?.c PRINT
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. Find version 37.2          22 May 1993                          3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. FIND(V37)                                               FIND(V37)
  203.  
  204.  
  205. DDIIAAGGNNOOSSTTIICCSS
  206.        Should really be more informative.
  207.  
  208.        ARexx  is  inaccessible:  Either  the  ARexx   interpreter
  209.        (RREEXXXXMMAASSTT)  isn't running or FFIINNDD was unable to create its
  210.        communications port.  FFIINNDD will not complain about this if
  211.        the  RREEXXXX function isn't used.  Thus it is possible to use
  212.        FFIINNDD on a system without Arexx.
  213.  
  214. BBUUGGSS
  215.        It may take several Ctrl-C's to halt FFIINNDD when EEXXEECC,  EEXXEE­­
  216.        CCOOKK, or RREEXXXX is used.
  217.  
  218.        Specifying the DDEEPPTTHH switch is an effective way of defeat­
  219.        ing the purpose of PPRRUUNNEE.  That may change in the  future.
  220.        (If  you  can  think  of  a good reason for making DDEEPPTTHH a
  221.        function, as in Unix  find,  instead  of  a  command  line
  222.        switch, please tell me).
  223.  
  224. SSEEEE AALLSSOO
  225.        LLIISSTT(AmigaDOS), RRXX(ARexx), SSEEAARRCCHH(AmigaDOS)
  226.  
  227.        The section on ARexx in the _U_s_i_n_g _T_h_e _S_y_s_t_e_m _S_o_f_t_w_a_r_e man­
  228.        ual.
  229.  
  230. AAUUTTHHOORR
  231.        Torsten Poulin (torsten@diku.dk)
  232.  
  233. UUNNRREESSTTRRIICCTTIIOONNSS
  234.        FFIINNDD is free; anyone may redistribute copies  of  FFIINNDD  to
  235.        anyone  under  the  terms stated in the GNU General Public
  236.        Licence, a copy of which accompanies each copy of FFIINNDD.
  237.  
  238.        Torsten Poulin encourages you to improve and extend  FFIINNDD,
  239.        and  urges  that  you  contribute  your  extensions to the
  240.        world.
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. Find version 37.2          22 May 1993                          4
  263.  
  264.  
  265.